/**
 * 
 */
package com.xbang.attendance.web.action.system.warning;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.xbang.attendance.entity.system.EntityWarning;
import com.xbang.attendance.service.SystemService;
import com.demo2do.lighturl.annotation.Action;
import com.xbang.core.page.Result;
import com.xbang.core.struts.support.SearchActionSupport;

/**
 * @author dev.zhang
 * 
 */
public class Index extends SearchActionSupport {

	private static final long serialVersionUID = 4604709900883572987L;

	@Autowired
	private SystemService systemService;

	private List<EntityWarning> entityWarnings = new ArrayList<EntityWarning>();

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.opensymphony.xwork2.ActionSupport#execute()
	 */
	@Action("/system/warning/list")
	public String list() throws Exception {

		String hqlSentence = "FROM EntityWarning entitywarning WHERE 1 = 1";

		Result result = systemService.searchByPage(hqlSentence, searchComponent, page);

		entityWarnings = result.getItems();
		page = result.getPage();
		return "index";
	}

	/**
	 * @param systemService
	 */
	public void setSystemService(SystemService systemService) {
		this.systemService = systemService;
	}

	/**
	 * @return the entityWarnings
	 */
	public List<EntityWarning> getEntityWarnings() {
		return entityWarnings;
	}

	/**
	 * @param entityWarnings
	 *            the entityWarnings to set
	 */
	public void setEntityWarnings(List<EntityWarning> entityWarnings) {
		this.entityWarnings = entityWarnings;
	}

	@Override
	public void resetCustomerSearchCriteria() {
		// TODO Auto-generated method stub

	}

}
